#!/bin/bash

index_start=20151203
index_end=20151232 #20151232 + 1
index_pre=logstash_api-
index_cnt=$index_start
es_url=http://192.168.61.10:19200
out_put=/home/wzq/workspace/no_cvs/dump_es/prod

function backOneIndex {
    echo $1
    # echo $es_url/$1
    # echo $out_put/$1.json
elasticdump \
  --input=$out_put/$1.json \
  --output=$es_url/$1 \
  --type=data
}

while [[ $index_cnt -ne $index_end ]]; do
    #statements
    index="${index_pre}${index_cnt}"
    #echo $index
    backOneIndex $index
    let index_cnt+=1
done
